Attribute VB_Name = "Declarations"
Option Explicit
Type POINTAPI
    X As Long
    Y As Long
End Type
Type LOGBRUSH
    lbStyle As Long
    lbColor As Long
    lbHatch As Long
End Type

Public Enum StockObjects
    WHITE_BRUSH = 0
    LTGRAY_BRUSH = 1
    GRAY_BRUSH = 2
    DKGRAY_BRUSH = 3
    BLACK_BRUSH = 4
    NULL_BRUSH = 5
    HOLLOW_BRUSH = NULL_BRUSH
    WHITE_PEN = 6
    BLACK_PEN = 7
    NULL_PEN = 8
    OEM_FIXED_FONT = 10
    ANSI_FIXED_FONT = 11
    ANSI_VAR_FONT = 12
    SYSTEM_FONT = 13
    DEVICE_DEFAULT_FONT = 14
    DEFAULT_PALETTE = 15
    SYSTEM_FIXED_FONT = 16
End Enum

Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function SetFocusAPI Lib "user32" Alias "SetFocus" (ByVal hWnd As Long) As Long
Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Any) As Long
Declare Sub SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
Declare Function InvalidateRect Lib "user32" (ByVal hWnd As Long, lpRect As Any, ByVal bErase As Long) As Long

Declare Function CreateBrushIndirect Lib "gdi32" (lpLogBrush As LOGBRUSH) As Long
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal wndrpcPrev As Long, ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Function CallWindowProcAny Lib "user32" Alias "CallWindowProcA" (ByVal wndrpcPrev As Long, ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function DefWindowProc Lib "user32" Alias "DefWindowProcA" (ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As StockObjects) As Long
Declare Function MoveToEx Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, lpPoint As Any) As Long
Declare Function LineTo Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long) As Long

Public Const NOTSRCERASE As Long = &H1100A6     ' (DWORD) dest = (NOT src) AND (NOT dest)
Public Const WHITENESS As Long = &HFF0062       ' (DWORD) dest = WHITE
Public Const BLACKNESS As Long = &H4262       ' (DWORD) dest = BLACK
Public Const SM_CXICON = 11
Public Const SM_CYICON = 12
Public Const BS_SOLID = 0
Public Const LB_FINDSTRING = &H18F
Public Const LB_GETITEMHEIGHT = &H1A1
Public Const LB_GETCOUNT = &H18B
Public Const LB_SETCOUNT = &H1A7
Public Const LB_SETSEL = &H185

Public Const SWP_NOACTIVATE = &H10
Public Const SWP_DRAWFRAME = &H20
Public Const SWP_NOZORDER = &H4
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOMOVE = &H2

Public Const WM_PAINT = &HF

Public Const WS_BORDER = &H800000
Public Const WS_VSCROLL = &H200000
Public Const WS_HSCROLL = &H100000
Public Const GWL_STYLE = (-16)
Public Const GWL_USERDATA = (-21)
Public Const GWL_WNDPROC = -4

Public Const VK_TAB = &H9
Public Const VK_SHIFT = &H10
Public Const VK_CONTROL = &H11

Type OSVERSIONINFO
    dwOSVersionInfoSize As Long
    dwMajorVersion As Long
    dwMinorVersion As Long
    dwBuildNumber As Long
    dwPlatformId As Long
    szCSDVersion As String * 128      '  Maintenance string for PSS usage
End Type

Public Type NMHDR
    hwndFrom As Long
    idfrom As Long
    Code As Long
End Type

Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long
Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" _
                    (ByVal dwExStyle As Long, _
                     ByVal lpClassName As String, _
                     ByVal lpWindowName As String, _
                     ByVal dwStyle As Long, _
                     ByVal X As Long, ByVal Y As Long, _
                     ByVal nWidth As Long, ByVal nHeight As Long, _
                     ByVal hWndParent As Long, _
                     ByVal hMenu As Long, _
                     ByVal hInstance As Long, lpParam As Any) As Long
Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Declare Function GetFocus Lib "user32" () As Long

Declare Function SetBkColor Lib "gdi32" (ByVal hDC As Long, ByVal crColor As Long) As Long
Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
Declare Function Rectangle Lib "gdi32" (ByVal hDC As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hDC As Long, ByVal lpstr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Declare Function SetTextColor Lib "gdi32" (ByVal hDC As Long, ByVal crColor As Long) As Long
Declare Function DrawFocusRect Lib "user32" (ByVal hDC As Long, lpRect As RECT) As Long
Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Declare Function DrawFrameControl Lib "user32" (ByVal hDC As Long, lpRect As RECT, ByVal un1 As Long, ByVal un2 As Long) As Long
Declare Function DrawEdge Lib "user32" (ByVal hDC As Long, qrc As RECT, ByVal edge As Long, ByVal grfFlags As Long) As Long
Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As Any) As Long
Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As Any) As Long

Public Const EDGE_SUNKEN = &HA
Public Const EDGE_RAISED = &H5
Public Const BF_RECT = &HF
Public Const DFC_SCROLL = 3
Public Const DFC_BUTTON = 4
Public Const DFCS_SCROLLUP = &H0
Public Const DFCS_SCROLLDOWN = &H1
Public Const DFCS_BUTTONCHECK = &H0
Public Const DFCS_BUTTONPUSH = &H10
Public Const DFCS_PUSHED = &H200
Public Const DFCS_CHECKED = &H400

Public Const COLOR_BACKGROUND = 1
Public Const COLOR_WINDOW = 5
Public Const COLOR_WINDOWTEXT = 8
Public Const COLOR_HIGHLIGHT = 13
Public Const COLOR_HIGHLIGHTTEXT = 14
Public Const COLOR_BTNFACE = 15
Public Const COLOR_BTNSHADOW = 16

Public Const PS_SOLID = 0

Public Const DT_LEFT = &H0
Public Const DT_VCENTER = &H4
Public Const DT_SINGLELINE = &H20
Public Const DT_NOCLIP = &H100
Public Const DT_NOPREFIX = &H800

Public Const SW_SHOW = 5

Public Const WS_CHILD = &H40000000
Public Const WS_CLIPSIBLINGS = &H4000000
Public Const WS_TABSTOP = &H10000
Public Const WS_EX_CLIENTEDGE = &H200

Public Const LBS_NOTIFY = &H1&
Public Const LBS_SORT = &H2&
Public Const LBS_MULTIPLESEL = &H8&
Public Const LBS_EXTENDEDSEL = &H800&
Public Const LBS_OWNERDRAWFIXED = &H10&
Public Const LBS_OWNERDRAWVARIABLE = &H20&
Public Const LBS_HASSTRINGS = &H40&
Public Const LBS_NOINTEGRALHEIGHT = &H100&
Public Const LBS_DISABLENOSCROLL = &H1000&
Public Const LBS_NODATA = &H2000&
Public Const LBS_MULTICOLUMN = &H200&

Public Const LB_ADDSTRING = &H180
Public Const LB_RESETCONTENT = &H184
Public Const LB_SETCURSEL = &H186
Public Const LB_GETSEL = &H187
Public Const LB_GETTEXT = &H189
Public Const LB_GETTEXTLEN = &H18A
Public Const LB_GETTOPINDEX = &H18E
Public Const LB_GETHORIZONTALEXTENT = &H193
Public Const LB_SETHORIZONTALEXTENT = &H194
Public Const LB_GETITEMRECT = &H198
Public Const LB_GETITEMDATA = &H199
Public Const LB_SETITEMDATA = &H19A
Public Const LB_SETCARETINDEX = &H19E
Public Const LB_GETCARETINDEX = &H19F
Public Const LB_SETITEMHEIGHT = &H1A0
Public Const LB_FINDSTRINGEXACT = &H1A2
Public Const CB_FINDSTRINGEXACT = &H158
Public Const LB_ITEMFROMPOINT = &H1A9
Public Const LB_INSERTSTRING = &H181
Public Const LB_DELETESTRING = &H182
Public Const LB_SETTOPINDEX = &H197

Public Const LBN_SELCHANGE = 1

'Owner draw type
Public Enum OwnerDrawType
    ODT_MENU = 1
    ODT_LISTBOX = 2
    ODT_COMBOBOX = 3
    ODT_BUTTON = 4
End Enum


'Owner draw action
Public Enum OwnerDrawAction
    ODA_DRAWENTIRE = &H1
    ODA_SELECT = &H2
    ODA_FOCUS = &H4
End Enum

' Owner draw state
Public Enum OwnerDrawState
    ODS_SELECTED = &H1
    ODS_GRAYED = &H2
    ODS_DISABLED = &H4
    ODS_CHECKED = &H8
    ODS_FOCUS = &H10
End Enum

Public Const WM_CTLCOLORLISTBOX = &H134
Public Const WM_DRAWITEM = &H2B
Public Const WM_SETFONT = &H30
Public Const WM_GETFONT = &H31
Public Const WM_SETFOCUS = &H7
Public Const WM_KILLFOCUS = &H8
Public Const WM_SYSCOLORCHANGE = &H15
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_MBUTTONDOWN = &H207
Public Const WM_LBUTTONUP = &H202
Public Const WM_RBUTTONUP = &H205
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_CHAR = &H102
Public Const WM_KEYDOWN = &H100
Public Const WM_SYSKEYDOWN = &H104
Public Const WM_SYSKEYUP = &H105
Public Const MK_SHIFT = &H4
Public Const MK_CONTROL = &H8
Public Const WM_SYSCOMMAND = &H112
Public Const WM_MOUSEACTIVATE = &H21
Public Const MA_NOACTIVATE = 3

Type DRAWITEMSTRUCT
    CtlType As OwnerDrawType
    CtlID As Long
    itemID As Long
    itemAction As OwnerDrawAction
    itemState As OwnerDrawState
    hwndItem As Long
    hDC As Long
    rcItem As RECT
    ItemData As Long
End Type
